<?php
if (!defined("_INDEX")) { header("Location: /"); die; }

require_once ADMIN.DS."/head.php";
?>
<h1>Список городов</h1><br />
<div class='floating'><a href='city/add'>Добавить город</a></div>
<table cellpadding='0' cellspacing='0' class='list'>
	<tr class='table_header'>
		<td width='50px'>ID</td>
		<td width='300px'>Название</td>
		<td width='200px'>Действия</td>
	</tr><?php
		$cities = $db->getTable("select * from `city` order by `name`");
		foreach($cities as $city)
		{
			echo "<tr><td>$city[city_id]</td>";
			echo "<td>$city[name]</td>";
			echo "<td><a href='city/edit/$city[city_id]' class='edit'>Редактировать</a> | <a href='city/delete/$city[city_id]' class='delete'>Удалить</a></td></tr>";	
		}
?></table>

<?php require_once ADMIN.DS."/footer.php"; ?>